package com.dragon.repository.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dragon.repository.entity.Produce;
import com.dragon.repository.entity.SchedulingOut;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 外发 Mapper 接口
 * </p>
 *
 * @author sy
 * @since 2023-11-29
 */
@Mapper
public interface SchedulingOutMapper extends BaseMapper<SchedulingOut> {
    @Select("SELECT M.* FROM (SELECT dso.*, dv.name as vendorName from dragon_scheduling_out dso " +
            "LEFT JOIN dragon_vendor dv on dv.id = dso.supplier_id )M " +
            "${ew.customSqlSegment}")
    Page<SchedulingOut> selectPageWrapper(Page<SchedulingOut> schedulingOutPage, @Param(Constants.WRAPPER) QueryWrapper<SchedulingOut> wrapper);
}
